** Start by using "clear" and "set more off" and pasting data from Excel **

** Replace blanks with zeros **
replace pto = 0 if pto == .
replace rex = 0 if rex == .
replace rei = 0 if rei == .
replace itf = 0 if itf == .
replace dist = 0 if dist == .
replace itc = 0 if itc == .
replace cl = 0 if cl == .
replace s145 = 0 if s145 == .
replace s101 = 0 if s101 == .
replace util = 0 if util == .
replace s102 = 0 if s102 == .
replace s103 = 0 if s103 == .
replace doubpat = 0 if doubpat == .
replace enab = 0 if enab == .
replace wd = 0 if wd == .
replace bm = 0 if bm == .
replace indef = 0 if indef == .
replace design = 0 if design == .
replace amdt = 0 if amdt == .

** age = years since 5/20/10 **
gen age = (11 + (9-1)/12 + (9-1)/365) - (real(substr(date,7,2)) + (real(substr(date,1,2)) - 1)/12 + (real(substr(date,4,2)) - 1)/365)
replace age = (11 + (9-1)/12 + (9-1)/365) + 100 - (real(substr(date,7,2)) + (real(substr(date,1,2)) - 1)/12 + (real(substr(date,4,2)) - 1)/365) if real(substr(date,7,2)) > 20

** 3 categories of cases that might fit in Masur's theory **
gen masur1 = 0
replace masur1 = 1 if (pto == 1 & invalid == 0)
gen masur2 = 0
replace masur2 = 1 if (pto == 1 & invalid != 1)
gen masur3 = masur2
replace masur3 = 1 if (rex == 1 & invalid != 1)
